/**
 * @Copyright ®2015 Sinosoft Co. Ltd. All rights reserved.
 * 项目名称 : 网站服务平台
 * 创建日期 : 2017-08-11
 * 修改历史 :
 * 1. [2017-08-11]创建文件 by chenxin
 */
package com.gavinwind.inspay.paycenter.router.service.impl;

import com.gavinwind.inspay.api.paychannel.apiservice.service.BatchPayApiService;
import com.gavinwind.inspay.api.paychannel.apiservice.service.GatewayPayApiService;
import com.gavinwind.inspay.api.paychannel.apiservice.service.PayInTimeApiService;
import com.gavinwind.inspay.base.BaseService;
import com.gavinwind.inspay.common.context.SpringContext;
import com.gavinwind.inspay.common.model.PayRequestDTO;
import com.gavinwind.inspay.paycenter.router.service.PayChannelRouterService;
import org.springframework.stereotype.Service;

/**
 * 【支付渠道路由服务类】
 * @author chenxin
 * @date 2017-08-11 下午5:29 
 * @version V1.0
 */
@Service
public class PayChannelRouterServiceImpl extends BaseService implements PayChannelRouterService {

    private final String PAYINTIME = "PayIntimeApiService";
    private final String BATCHPAY = "BatchPayApiService";
    private final String GATEPAY = "GatewayPayApiService";

    public String routerPayChnl(PayRequestDTO cPayReq) {
        return "alipay";
    }

    public PayInTimeApiService generatePayIntimeApiService(String cPayChnlCode) {
        PayInTimeApiService interPayApiService = (PayInTimeApiService) SpringContext.getBean(cPayChnlCode + PAYINTIME);
        return interPayApiService;
    }

    public BatchPayApiService generateBatchPayApiService(String cPayChnlCode) {
        BatchPayApiService interPayApiService = (BatchPayApiService) SpringContext.getBean(cPayChnlCode + BATCHPAY);
        return interPayApiService;
    }

    public GatewayPayApiService generateGatewayPayApiService(String cPayChnlCode) {
        GatewayPayApiService interPayApiService = (GatewayPayApiService) SpringContext.getBean(cPayChnlCode + GATEPAY);
        return interPayApiService;
    }

}
